<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue中同时使用过渡和动画</title>
    <script src="../vue.js"></script>
    <link rel="stylesheet" type="text/css" href="./animate.css">
    <style>
        .fade-enter,
        .fade-leave-to {
            opacity: 0;
        }
        .fade-enter-active,
        .fade-leave-active{
            transition: opacity 1s;
        }
    </style>
</head>
<body>
    <div id="root"> 
        <!-- <transition
            type="transition"
            name = "fade"
            appear
            enter-active-class=”animate__animated animate__swing”
            leave-active-class="animate__animated animate__shake"
            appear-active-class="animate__animated animate__swing"
        > -->
        <transition
            :duration="{enter: 5000,leave: 10000}"
            name = "fade"
            appear
            enter-active-class=”animate__animated animate__swing”
            leave-active-class="animate__animated animate__shake"
            appear-active-class="animate__animated animate__swing"
        >
            <div v-if ="show">hello world </div>
        </transition>       
        <button @click="handleBtnClick">change</button>
    </div>   
    
    <script>    
       
    
        var root = new Vue({
            el: '#root',
            data: {
                show: true
            },            
            methods: {
                handleBtnClick: function(){
                    this.show = ! this.show
                }
            }        
           
        });
    </script>
</body>
</html>